function fileList = getFiles(dirName)
%getFiles - returns all files (not folders!) in the directory.
  dirData = dir(dirName);      % Get the data for the current directory
  dirIndex = [dirData.isdir];  % Find the index for directories
  fileList = {dirData(~dirIndex).name}';  % Get a list of the files
  % Prepend path to files
  if ~isempty(fileList)
    fileList = cellfun(@(x) fullfile(dirName,x),...  
                       fileList,'UniformOutput',false);
  end
  fileList = sort(fileList);
end